﻿using System.Collections.Generic;

public class GameData {
	// === Public =====================================================================================================
	public List<FieldElement> Elements { get; private set; }
	public List<FieldBody> Bodies { get; private set; }

	public static GameData GetInstance {
		get { return _instance ?? (_instance = new GameData()); }
	}

	public void AddElement(FieldElement element) {
		Elements.Add(element);
	}

	public void RemoveElement(FieldElement element) {
		Elements.Remove(element);
	}

	public void AddBody(FieldBody body) {
		Bodies.Add(body);
	}

	public void RemoveBody(FieldBody body) {
		Bodies.Remove(body);
	}

	public void ResetGame() {
		Managers.Body.DestroyBodies();
		Managers.Element.DestroyElements();
	}

	// === Private ====================================================================================================
	private static GameData _instance;

	private GameData() {
		Elements = new List<FieldElement>();
		Bodies = new List<FieldBody>();
	}
}
